1. Field of the Invention
The present invention relates to a method and system for processing an image, a method and apparatus for decoding, a method and apparatus for encoding, and a program. More specifically, the present invention relates to a method and system for processing an image, a method and apparatus for decoding, a method and apparatus for encoding, and a program, which allow it to achieve high image quality.
2. Description of the Related Art
To transmit information from broadcast stations and to receive the information, a technique/apparatus according to the MPEG (Moving Picture Experts Group) standard is widely used. In the MPEG method, to achieve high efficiency in transmission and storage of information, moving image data is treated in the form of digital data and compressed using redundancy of the moving image by performing an orthogonal transformation such as a discrete cosine transform and moving compensation on the moving image.
For example, the MPEG-2 (ISO (International Organization for Standardization)/IEC (International Electrotechnical Commission) 13818-2) standard has been established as a standard for an encoding method for general-purpose moving images. The MPEG-2 supports both interlaced scanning images and progressive scanning images, and also supports both normal-definition images and high-definition images. The MPEG-2 standard is used in a wide variety of applications including professional applications and consumer applications.
In the MPEG-2 standard, a high compression ratio and high image quality can be achieved by assigning a bit rate (amount of code) of 4 to 8 Mbps to an interlaced scanning image having a normal resolution with 720×480 pixels. For an interlaced scanning image having a high resolution with 1920×1088 pixels, a high compression ratio and high image quality can be achieved by assigning a bit rate of 18 to 22 Mbps. In some encoders adapted to encode a moving image by the MPEG-2 method, a selection as to whether to use field prediction or frame prediction is made depending on luminance and color difference signals of the moving image (see, for example, Japanese Unexamined Patent Application Publication No. 2003-174653).
The MPEG-2 standard has been originally designed for high-quality images for use in broadcasting or the like, and the MPEG-2 standard does not support encoding at lower bit rates than the bit rates supported by the MPEG-1 standard, that is, the MPEG-2 standard does not support high-efficiency encoding. Portable terminal devices have come into wide use. As a result, there is an increasing need for a high-efficiency encoding method. To meet the above requirement, the MPEG-4 standard has been proposed. The proposed method of encoding images according to the MPEG-4 standard was officially approved in December of 1993 as international standard ISO/IEC14496-2.
Following the MPEG methods, an encoding method called JVT (Joint Video Team) encoding method (H.264/AVC (Advanced Video Coding) method) has been proposed to achieve a higher compression ratio. In the JVT method, as with the MPEG methods, motion prediction and motion compensation are performed on the basis of motion vectors in encoding of moving images.
The JVT method supports a weighted prediction mode which allows motion compensation in a fade-out/in effect, in which an image gradually disappears or appears or in a cross fade effect in which a scene is gradually changed by means of a combination of fade-out and fade-in, which are difficult by motion prediction based on motion vectors. Use of the weighted prediction mode according to the JVT method allows it to encode a moving image in a fade period without producing significant degradation in image quality.
In the weighted prediction mode, when prediction is performed for a P-picture or a B-picture of a moving image in producing of a predicted image, pixel values of a reference image are weighted. The weighted prediction mode has two sub-modes: an explicit weighted prediction mode in which weighting factors for B-pictures are explicitly specified; and an implicit weighted prediction mode in which weighting factors are automatically determined in accordance with difference in time from a reference image.